<template>
	<view class="information-lists-area">
		<navigator <navigator hover-class="none" :url="`/yixu/pages/network_square/contents/info?id=${v.id}&type=2`" class="information-item u-padding-30" v-for="(v,k) in listDatas" :key="k">
			<view class="u-flex u-padding-bottom-30">
				<u-avatar :src="v.avatar" :size="86"></u-avatar>
				<view class="u-flex u-flex-1 u-padding-left-25">
					<view class="u-flex-1">
						<view class="u-flex u-margin-bottom-10">
							<text class="lg u-font-weight-500 u-padding-right-25">{{v.name}}</text>
							<u-tag v-if="v.position" :text="v.position" bg-color="rgba(0, 153, 255, 0.28)"
								color="#333333" shape="circle" />
						</view>
						<u-icon :label="v.company_city" size="35" name="map"></u-icon>
					</view>
					<u-button hover-class="none" size="mini" shape="circle" :custom-style="{
							color: '#FFFFFF',
							background: '#0099FF',
							borderColor: '#0099FF'
						}">打招呼</u-button>
				</view>
			</view>
			<u-gap height="2" bg-color="#F2F3F5"></u-gap>
			<view class="area-bg u-padding-25 u-margin-top-20 u-color-333333">
				
				<u-icon v-if="v.type_desc" :label="v.type_desc||''" size="30" name="tags-fill" color="#66a6ff" label-color="#66a6ff"></u-icon>
				
				<view  v-if="v.type == 1" :class="{'u-margin-top-25':v.type_desc}">
					<view>
						<text class="bold">产品名称：</text>
						<text class="u-font-weight-500">{{v.product_name||''}}</text>
					</view>
					<view class="u-margin-top-15">
						<text class="bold">产品月息：</text>
						<text class="u-font-weight-500">{{v.interests||''}}</text>
					</view>
					<view class="u-margin-top-15">
						<text class="bold">产品额度：</text>
						<text class="u-font-weight-500">{{v.quota||0}}万</text>
					</view>
					<view v-if="v.describe">
						<view class="bold u-margin-top-15">
							产品优势描述
						</view>
						<view class="nr u-margin-top-15">
							{{v.describe||''}}
						</view>
					</view>
				</view>
				<view v-if="v.demand" class="u-margin-top-15">
					<view class="bold" >
						合作需求
					</view>
					<view class="nr u-margin-top-15">
						{{v.demand||''}}
					</view>
				</view>
				
			</view>
			<view class="u-flex u-row-between u-color-666666 xs u-margin-top-25 u-padding-bottom-25">
				<text>{{v.create_time}}</text>
				<u-icon :label="v.look_count" name="eye" size="24" label-size="24"></u-icon>
				<like :isSelect="v.is_like" :likeCount="v.like_count" :articleType="2" :articleId="v.id"></like>
			</view>
			<u-gap height="2" bg-color="#F2F3F5" v-if="(k + 1) < listDatas.length"></u-gap>
		</navigator>
		<u-empty v-if="listDatas.length <= 0" class="u-padding-top-50 u-padding-bottom-50" text="暂无数据" mode="list"></u-empty>
	</view>
</template>

<script>
	import {
		queryCooperationLists
	} from '@/api/networkSquare'
	import {
		loadingType
	} from "@/utils/type";
	import {
		loadingFun
	} from "@/utils/tools"
	import like from '@/yixu/pages/network_square/components/like.vue'
	export default {
		components:{
			like
		},
		data() {
			return {
				page: 1,
				listDatas: [],
				initStatus: false,
				loadingStatus: loadingType.LOADING,
			}
		},
		props: {
			city_id: {
				default: ''
			},
			keyword: {
				default: ''
			}
		},
		created() {
			this.queryListsDatas()
		},
		methods: {
			clearDatas() {
				this.page = 1;
				this.listDatas = [];
				this.loadingStatus = loadingType.LOADING;
			},
			queryListsDatas() {
				let requestParams = {
					city_id: this.city_id,
					keyword: this.keyword
				}
				let {
					page,
					listDatas,
					loadingStatus
				} = this;
				loadingFun(queryCooperationLists, page, listDatas, loadingStatus, requestParams).then(res => {
					if (res) {
						this.page = res.page;
						this.listDatas = res.dataList
						this.loadingStatus = res.status
						console.log(listDatas)
						if(!this.initStatus){
							this.$emit('initComplete')
							this.initStatus = true
						}
						
					}
				})
			}
		}
	}
</script>

<style>
	.area-bg {
		border-radius: 10rpx;
		background: #F7F7F7;
	}
</style>